package org.hgvc.webapp.ets.jsf.beans;

import org.hgvc.webapp.ets.constant.AdminConstant;
import org.hgvc.webapp.ets.jsf.beans.admin.AdminTerminateLogBean;
import org.hgvc.webapp.ets.jsf.beans.finance.MemberAccountBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.AgentBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.BranchBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.CalendarBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.CountryBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.CurrencyBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.CurrencyRateBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.DocControlBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.HotelResortBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.InstallmentSchemaBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.ProductBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.RaceBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.RciResortBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.RoomTypeBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.SalutationBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.StateBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.StatusBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.TerritoryBean;
import org.hgvc.webapp.ets.jsf.beans.mastersetup.TransTypeBean;
import org.jocsb.base.AbstractBean;


public class MenuBean extends AbstractBean{
	public static final String BEAN_NAME="menuBean";
	
	private String cacheUserId;
	
	public String getCacheUserId() {
		return cacheUserId;
	}

	public void setCacheUserId(String cacheUserId) {
		this.cacheUserId = cacheUserId;
	}

	public String navTerminateLogListAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		return outcome;
	}
	
	public String navCountryAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		outcome = outcome.concat("_"+getRoleName());
		CountryBean countryBean = (CountryBean) getNewManagedBean(CountryBean.BEAN_NAME);
		countryBean.init();
		
		return outcome;
	}
	
	public String navSalutationAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		outcome = outcome.concat("_"+getRoleName());
		SalutationBean salutationBean = (SalutationBean) getNewManagedBean(SalutationBean.BEAN_NAME);
		salutationBean.init();
		
		return outcome;
	}
	
	public String navRaceAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		outcome = outcome.concat("_"+getRoleName());
		RaceBean raceBean = (RaceBean) getNewManagedBean(RaceBean.BEAN_NAME);
		raceBean.init();
		
		return outcome;
	}
	
	public String navCurrencyAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		
		CurrencyBean currencyBean = (CurrencyBean) getNewManagedBean(CurrencyBean.BEAN_NAME);
		currencyBean.init();
		
		return outcome;
	}
	
	public String navCurrencyRateAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		
		CurrencyRateBean currencyRateBean = (CurrencyRateBean) getNewManagedBean(CurrencyRateBean.BEAN_NAME);
		currencyRateBean.init();
		
		return outcome;
	}
	
	public String navDocControlAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS.concat("_"+getRoleName());
		
		DocControlBean docControlBean = (DocControlBean) getNewManagedBean(DocControlBean.BEAN_NAME);
		docControlBean.init();
		
		return outcome;
	}
	
	public String navSearchProspectDepositPayment(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		return outcome;
	}
	
	public String navSearchProspectRefundPayment(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		return outcome;
	}
	
	public String navMemberAccountAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		
		MemberAccountBean memberAccountBean  = (MemberAccountBean) getNewManagedBean(MemberAccountBean.BEAN_NAME);
		memberAccountBean.initSearchMember();
		
		return outcome;
	}
	
	public String navMemberAccountInvoicingAction(){
		String outcome=AdminConstant.NAV_STATUS_SUCCESS;
		
		MemberAccountBean memberAccountBean  = (MemberAccountBean) getNewManagedBean(MemberAccountBean.BEAN_NAME);
		memberAccountBean.initSearchMember();
		
		return outcome;
	}
	
	public String navBranchAction(){
		return BranchBean.NAV_LIST_BRANCH;
	}
	
	public String navAgentAction(){
		return AgentBean.NAV_LIST_AGENT;
	}
	
	public String navHotelResortAction(){
		return HotelResortBean.NAV_LIST_HOTELRESORT;
	}
	
	public String navProductAction(){
		return ProductBean.NAV_LIST_PRODUCT;
	}
	
	public String navRciResortAction(){
		return RciResortBean.NAV_LIST_HOTELRCIRESORT;
	}
	
	public String navRoomTypeAction(){
		return RoomTypeBean.NAV_LIST_HOTELROOMTYPE;
	}
	
	public String navStatusAction(){
		return StatusBean.NAV_LIST_STATUS;
	}
	
	public String navTransTypeAction(){
		return TransTypeBean.NAV_LIST_TRANSACTIONTYPE;
	}
	
	public String navStateAction(){
		return StateBean.NAV_LIST_STATE.concat("_"+getRoleName());
	}
	
	public String navTerritoryAction(){
		return TerritoryBean.NAV_LIST_TERRITORY.concat("_"+getRoleName());
	}
	
	public String navHomeAction(){
		return ActionBulletinBean.NAV_HOME;
	}
	
	
	public String navCalendarAction(){
		return CalendarBean.NAV_LIST_CALENDAR;
	}
	
	public String navSchemaAction(){
		return InstallmentSchemaBean.NAV_LIST_SCHEMA;
	}
	
	public String getReqContextPath(){
	//	System.out.println("url="+getRequest().getContextPath().substring(1));
		return getRequest().getContextPath().substring(1);
	}
	
	public String getUserRoleName(){
		return getRoleName();
	}
}
